import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/allgoods',
    name: 'AllGoods',
    component: () => import(/* webpackChunkName: "allgoods" */ '../views/AllGoods.vue')
  },
  {
    path: '/myorders',
    name: 'Frees',
    component: () => import(/* webpackChunkName: "frees" */ '../views/Frees.vue')
  },
  {
    path: '/myorders',
    name: 'MyOrders',
    component: () => import(/* webpackChunkName: "myorders" */ '../views/MyOrders.vue')
  },
  {
    path: '/personal',
    name: 'Personal',
    component: () => import(/* webpackChunkName: "personal" */ '../views/Personal.vue')
  },
  {
    path: '/gooddetail',
    name: 'GoodDetail',
    component: () => import(/* webpackChunkName: "gooddetail" */ '../views/GoodDetail.vue')
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
